<?php 
	if (isset($_POST['capnhathinh']))
	{
		$MaSanPham = $_REQUEST['MaSanPham'];
		$MaHinh = $_REQUEST['MaHinh'];
		$name="../Another/Images/SanPham/".$_FILES['HinhAnh']['name'];	
		include "connection.php";
		$sql="UPDATE hinhanh SET MaHinh='".$MaHinh."', MaSanPham='".$MaSanPham."', DuongDan='".$name."'
		WHERE MaHinh='" .$MaHinh."'";
		if (!mysql_query($sql))
		{
			die('Error: ' . mysql_error());
		}
		header("location:../MyModel/TrangAD_qlhinhanh.php");
		mysql_close($con);
	}
?>